+2007-06-30 Richard Hult <richard@imendio.com>
+
+ * gdk/quartz/GdkQuartzView.c: Improve the tracking rect updating:
+ - No need to override setFrame.
+ - Use our own size instead of the bounds from for the view as it's
+ not always updated before the tracking rect.
+ - Only reset the tracking rect if the new window is nil).
+
+ * gdk/quartz/GdkQuartzWindow.c: Update the bounds of the content
+ view when the window size changes.
+
2007-06-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbuilderparser.c (_gtk_builder_parse_boolean):
/* GdkQuartzView.m
*
- * Copyright (C) 2005 Imendio AB
+ * Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
{
GdkWindowObject *private = GDK_WINDOW_OBJECT (gdk_window);
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
+ NSRect rect;
if (trackingRect)
{
if (!impl->toplevel)
return;
- trackingRect = [self addTrackingRect:[self bounds]
+ /* Note, if we want to set assumeInside we can use:
+ * NSPointInRect ([[self window] convertScreenToBase:[NSEvent mouseLocation]], rect)
+ */
+
+ rect = NSMakeRect (0, 0, impl->width, impl->height);
+ trackingRect = [self addTrackingRect:rect
owner:self
userData:nil
assumeInside:NO];
-(void)viewWillMoveToWindow:(NSWindow *)newWindow
{
- if ([self window] && trackingRect)
+ if (newWindow == nil && trackingRect)
{
[self removeTrackingRect:trackingRect];
trackingRect = nil;
}
}
--(void)setFrame:(NSRect)frame
-{
- [super setFrame:frame];
- [self updateTrackingRect];
-}
-
-(void)setBounds:(NSRect)bounds
{
[super setBounds:bounds];
impl->width = content_rect.size.width;
impl->height = content_rect.size.height;
+ [[self contentView] setBounds:NSMakeRect (0, 0, impl->width, impl->height)];
+
/* Synthesize a configure event */
event = gdk_event_new (GDK_CONFIGURE);
event->configure.window = g_object_ref (window);